package com.zf.admin.service.Impl;

import com.zf.admin.pojo.Userlist;
import com.zf.admin.dao.UserlistMapper;
import com.zf.admin.service.UserlistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserlistServiceImpl implements UserlistService {

    @Autowired
    private UserlistMapper userlistMapper;

    @Override
    public Userlist findhasuserlist(Integer user_id) {
        Userlist userlist = userlistMapper.findhasuserlist(user_id);
        return userlist;
    }

    @Override
    public Userlist checkuserlist(String idcard) {
        Userlist userlist = userlistMapper.checkuserlist(idcard);
        return userlist;
    }

    @Override
    public void insertuserlist(Userlist userlist) {
        userlistMapper.insertuserlist(userlist);

    }

    @Override
    public void updateuserlist(Userlist userlist) {
        userlistMapper.updateuserlist(userlist);

    }

    @Override
    public Userlist finduserlistupdate(Userlist userlist) {
        Userlist list = userlistMapper.finduserlistupdate(userlist);
        return list;
    }

    @Override
    public List<Userlist> findalluserlist() {
        List<Userlist> list = userlistMapper.findalluserlist();
        return list;
    }

    @Override
    public void deleteuserlist(Integer id) {
        userlistMapper.deleteuserlist(id);
        userlistMapper.deleteuser(id);
    }

}
